<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			var arr4 = [10, 20, 30, 40];

			for (var i = 0; i < arr4.length; i++) {
				console.log(arr4[i]);
			}

			for (var i in arr4) {
				console.log(arr4[i]);
			}

			var arr5 = [{
					id: 1,
					name: "张三",
					age: 18
				},
				{
					id: 2,
					name: "李四",
					age: 18
				},
				{
					id: 3,
					name: "王五",
					age: 18
				},
			]

			document.write("<table border='1'>");
			document.write("<tr>");
			document.write("<td>学号</td><td>姓名</td><td>年龄</td>")
			document.write("</tr>");
			for (var i in arr5) {
				document.write("<tr>");

				var stu = arr5[i];
				document.write("<td>");
				document.write(stu.id)
				document.write("</td>");
				document.write("<td>");
				document.write(stu.name)
				document.write("</td>");
				document.write("<td>");
				document.write(stu.age)
				document.write("</td>");

				document.write("</tr>");
			}
			document.write("</table>");
		</script>
	</body>
</html>
